﻿using ELearningSystem.Gateway.Entities;
using FluentNHibernate.Mapping;

namespace ELearningSystem.Gateway.Mappings
{
    public class LearnerMap : ClassMap<Learner>
    {
        public LearnerMap()
        {
            Id(x => x.Id);
            Map(x => x.Name);
            Map(x => x.Password);
            Map(x => x.EmailAddress);
            Map(x => x.Role);
            HasMany(x => x.Attempts)
                .Not.LazyLoad()
                .Not.Inverse()
                .Cascade.All();
        }
    }
}
